Many different types of computer application programs, such as desktop publishing programs, word processing programs, graphic design programs, and web page authoring programs, provide the capability for users to display text in a number of different manners, to provide a variety of different effects. For instance, users can control the appearance of the text by selecting different fonts, as well as various characteristics of the text, including its size, style, weight and the like. Many of these characteristics are included within the definition of a font. For instance, a font might contain one set of character images, or glyphs, for plain text, another set of glyphs for bold text, and yet another set of glyphs for italicized text.
Another attribute of text, which can be employed with great effectiveness to create different impressions, is its color. For instance, individual words in a document can be printed in bold colors, such as red or blue, to draw the reader's attention to a specific concept. In another context, a variety of colors can be used for different portions of text, to create fanciful presentations. In the past, color did not form a component of a font definition itself. Rather, the individual glyphs of a font were defined as monochrome images. For instance, one approach that is employed to define glyph images employs a bitmap of the image. In this approach, each pixel of an image is defined as being “on” or “off”. When the image of a character is to be displayed on a computer monitor or printed on paper, the “on” pixels are displayed or printed with a designated foreground color, e.g. black, and the “off” pixels are not printed, or are displayed as a background color, to thereby form the image of a character. To change the color of the character, the designated foreground color is varied. Thus, for example, if the new foreground color is designated as red, the entire character appears in the color red, rather than black.
An alternative approach to defining the glyphs of a font is to characterize them by their geometric shapes. In this approach, the outline of the font is defined, for example by mathematical formulas. When the character is to be displayed, the area within the defined outline is filled with the foreground color. In a similar manner, the color of the character can be changed, by designating a different foreground color.
To provide greater versatility in the appearance of glyphs, it is desirable to employ multiple colors within the image of a single character or symbol. For example, it may be desirable to display one or more edges of a character in a color that contrasts with the main color of the character, to create a shadow effect. In another situation, it may be desirable to display or print a glyph in a pattern of colors that represent the colors of a country's flag, or other symbolic image. One technique that permits the glyphs of an outline font to be displayed with multiple colors is disclosed in copending application Ser. No. 6,091,505, commonly assigned herewith. In the technique disclosed therein, different components of the outline can be defined in respective layers, and each layer can be displayed in a different color.
For bitmapped fonts, it is possible to designate different colors by employing multiple bits for each pixel of the glyph image. However, such an approach can significantly increase the amount of data that is required to define the font. For instance, in a system which is capable of displaying up to 256 different colors, 8 bits are required to uniquely designate any given color. It will be appreciated that, if 8 bits are required to define each pixel within each glyph of the font, the amount of memory required to store the font will become excessive.
Accordingly, it is desirable to provide a technique which permits colors and other multi-valued attributes of glyphs to be defined within bitmapped font images, but which does so with a limited amount of data, to thereby minimize storage requirements.